﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="HoiDap.aspx.cs" Inherits="WebBanThuoc.HoiDap" %>
<%@ Register Assembly="MSCaptcha" Namespace="MSCaptcha" TagPrefix="cc1" %> 
<asp:Content ID="Content2" ContentPlaceHolderID="main" runat="server">
<script type="text/javascript">
         $(document).ready(function () {
           var $chosen = <%=Request.QueryString["trang"] %>;
             $(".page").click(function () {
                 $(this).addClass("page_click");
             });
             $(".page").each(function () {
                 if ($(this).html() == $chosen) {
                     $(this).addClass("page_click");
                 }
             });


         });
</script>
<div class="tran_nav">
    <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" style="width:30px; display:inline;">
          <a href="TrangChu.aspx" itemprop="url" >
            <span itemprop="title">Trang chủ</span>
          </a> 
        </div>  
        <font>&raquo;</font>
        <div itemscope itemtype="http://data-vocabulary.org/Breadcrumb" style="width:30px;  display:inline;">
               <span itemprop="title">Hỏi & đáp</span>
         </div>  
        
  </div>

  <asp:UpdatePanel ID="faq_updatePanel" runat="server" >
    <ContentTemplate>
 <!--<div class="product_info" align="left" style="min-height:200px;">-->
   <div class="middle_content_cart" style="margin-left:3px;"  >
    <div  class="product_title" align="left" style="width:573px;margin-left:1px; margin-top:1px;"><h1>  Đặt câu hỏi</h1> </div>
                 
            <div  class="shopping_cart" style="padding:5px; width:574px">
           
              <asp:ScriptManager ID="scritpManager1" runat="server" EnablePageMethods="True" />
              <!--<div style="float:left; width:100%; height:50px; margin:5px; background: url(images/u.png) no-repeat 2px top left ; ">
               <span style="padding-left:60px; font-size:16px; font-weight:600; color:#55B7E6">Gửi phản hồi</span>  
               </div>  -->
               <table border="0" align="center" cellpadding="5" cellspacing="5" style="font-size:14px; margin-top:10px">
                 <tr>
                     <td class="td_dangky" >Họ và tên:</td>
                    <td class="td_dangky1" >
                       <asp:TextBox ID="faq_ten" runat="server" ToolTip="Nhập họ và tên" Width="222px" Height="20px" CssClass="tbox" ></asp:TextBox></td>
                    <td class="td_dangky2">
                    <asp:RequiredFieldValidator ID="faq_ten_Required" runat="server" Display="Dynamic" 
                                                      ControlToValidate="faq_ten" ErrorMessage="Bạn chưa nhập họ và tên." Font-Size="11px" Font-Italic="True"></asp:RequiredFieldValidator>
                     <asp:CustomValidator ID="faq_CustomValidator_ten" runat="server" Display="Dynamic"  
                                                ErrorMessage="Địa chỉ không được có mã HTML" ControlToValidate="faq_ten" Font-Size="11px" Font-Italic="True"  
                                                ClientValidationFunction="faq_Validate_ten"></asp:CustomValidator>
                    </td>
                  </tr>
                  <tr>
                        <td class="td_dangky" >Email:</td>
                        <td class="td_dangky1" >
                           <asp:TextBox ID="faq_email" runat="server" ToolTip="Nhập địa chỉ email (vd: someone@example.com)" Width="222px" Height="20px" CssClass="tbox" ></asp:TextBox></td>
                        <td class="td_dangky2">
                        <asp:RequiredFieldValidator ID="faq_EmailRequired" runat="server" Display="Dynamic" 
                                                          ControlToValidate="faq_email" ErrorMessage="Bạn chưa nhập email." Font-Size="11px" Font-Italic="True"></asp:RequiredFieldValidator>
                         <asp:RegularExpressionValidator ValidationExpression="^([\w-_]+\.)*[\w-_]+@([\w-_]+\.)*[\w-_]+\.[\w-_]+$"
                        ControlToValidate="faq_email" ID="faq_ValEmail" runat="server" 
                        ErrorMessage="Email không hợp lệ." Display="Dynamic" Font-Size="11px" Font-Italic="True" ></asp:RegularExpressionValidator>
                       </td>
                     </tr>
                   <tr>
                    <td class="td_dangky" >Điện thoại:</td>
                    <td class="td_dangky1">
                        <asp:TextBox ID="faq_phone" runat="server" Width="222px" Height="20px" CssClass="tbox" ToolTip="Nhập số điện thoại.Vd: 0903688806 / 38326675"></asp:TextBox>
                    </td>
                        <td class="td_dangky2">
                        <asp:RequiredFieldValidator ID="faq_RequiredPhone" runat="server" Display="Dynamic" 
                                                      ControlToValidate="faq_phone" ErrorMessage="Bạn chưa nhập số điện thoại." Font-Size="11px" 
                                        Font-Italic="True"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ValidationExpression="\d{7,11}" 
                                ControlToValidate="faq_phone" ID="faq_RegExpVal_txtPhone" runat="server" 
                                ErrorMessage="Số điện thoại không đúng định dạng." Display="Dynamic" Font-Size="11px" 
                                        Font-Italic="True" ></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                      <td class="td_dangky">Chủ đề:</td>
                      <td class="td_dangky1">
                          <asp:TextBox ID="faq_chude" runat="server" Width="222px" Height="20px" CssClass="tbox" ToolTip="Nội dung tóm tắt của phản hồi."></asp:TextBox>
                       </td>
                       <td class="td_dangky2">
                            <asp:CustomValidator ID="faq_CustomValidator_chude" runat="server" Display="Dynamic"  
                                                ErrorMessage="Không được có mã HTML" ControlToValidate="faq_chude" Font-Size="11px" Font-Italic="True"  
                                                ClientValidationFunction="faq_Validate_chude"></asp:CustomValidator> 
                       </td>
                      </tr>
                     
                    <tr>
                      <td class="td_dangky">Nội dung:</td>
                      <td class="td_dangky1">
                         <textarea id="faq_noidung" runat="server" class="textarea_content"  rows="3" style="width:380px" ></textarea>
                       </td>
                       <td class="td_dangky2">
                            <asp:CustomValidator ID="faq_CustomValidator_noidung" runat="server" Display="Dynamic"  
                                                ErrorMessage="Không được có mã HTML" ControlToValidate="faq_noidung" Font-Size="11px" Font-Italic="True"  
                                                ClientValidationFunction="faq_Validate_noidung"></asp:CustomValidator> 
                       </td>
                      </tr>
                     <tr>
                        <td class="td_dangky" valign="middle" style="margin-top:15px;"> Mã bảo vệ:</td>
                        <td colspan="2" valign="middle">
                           <div style="width:420px; margin:0px; float:left;">
                               <asp:TextBox ID="faq_sCode" runat="server" MaxLength="5" style="width:100px; height:20px;margin-top:15px; float:left" CssClass="tbox" />
                               <cc1:CaptchaControl ID="faq_ccJoin" runat="server" CaptchaBackgroundNoise="Medium" CssClass="float_cap"
                                    CaptchaLength="5" 
                                    CaptchaHeight="50" 
                                    CaptchaWidth="180" 
                                    CaptchaLineNoise="None" 
                                    CaptchaMinTimeout="5"
                                     CaptchaMaxTimeout="240" Width="180px" style="float:left;" />
                               
                            </div> 
                        </td>
                     </tr>
                     <tr>
                         <td colspan="3">
                           <asp:Label ID="faq_thongbao" runat="server" style="margin-left: 80px;color: #FF3300; font-style:italic; margin-bottom:10px; margin-top:10px"></asp:Label>
                         </td>
                     </tr>
                     <tr>
                     <td colspan="2">
                       <asp:Button ID="faq_Submit" runat="server" Text="Gửi" 
                              CssClass=" cart_button_send" CausesValidation="True" Width="77px" Height="33px" 
                             style="margin-left: 80px; float:left; font-size:14px; font-weight:700" onclick="faq_Submit_Click" />
                    </td>
                   </tr>
                    
               </table>
           
            </div> <!--End of div d_info-->
                
           
  </div> <!--middle_content_cart-->
<!--</div>-->

 </ContentTemplate>
 </asp:UpdatePanel> 

<div class="middle_content_cart" style="margin-left:3px;"  >
    <div  class="product_title" align="left" style="width:573px;margin-left:1px; margin-top:1px;"><h1> Hỏi & đáp</h1> </div>
              
 <div  class="shopping_cart" style="padding:5px; width:573px">

  <% System.Collections.Generic.List<WebBanThuoc.DTO.BaiDang> listBD = Session["listBD"]
                     as System.Collections.Generic.List<WebBanThuoc.DTO.BaiDang>;%> 
  <% if (listBD.Count > 0)
     { %>
   <% for (int i = 0; i < listBD.Count; i++)
      {%>
        <% if (i > 0)
           {%>
           <div style="width:100%; border-bottom: 1px solid #D2D1D1; float:left ">
            &nbsp;
           </div>
        <%} %>
      <div class="question">
           <p><strong><%=listBD[i].TenCauHoi%>&nbsp-&nbsp<%=listBD[i].NgayDang%></strong></p>
           <p><span><%=listBD[i].NoiDung%> &nbsp </span></p>
           <p><span style="font-style:italic; float:right; color:red">(<%=listBD[i].TenNguoiHoi%>)</span></p>
       </div>
         <div class="response">
           <p><span style="text-decoration:underline; font-weight:600">Trả lời </span>:&nbsp
           <span style="color:Black"><%=listBD[i].TraLoi%></span></p>
          </div>
          
     <% } %>
     <% } %>
  </div>
  </div>
  <!--bắt đầu trang -->
    <div class="paging">
     <%int faq_tongSoTrang = Session["faq_tongSoTrang"] != null ? Convert.ToInt32(Session["faq_tongSoTrang"]) : 0;
          for (int i = 1; i <= faq_tongSoTrang; i++)
          { %>
            <a href="HoiDap.aspx?trang=<%= i %>"> <span class='page'><%= i %></span></a>
            <%}%>
    </div> 
        <!--kết thúc trang -->
   <script type="text/javascript">
       function faq_Validate_noidung(x, y) {
           str = (document.getElementById('<%=faq_noidung.ClientID %>')).value;
           if (str.match(/([\<])([^\>]{1,})*([\>])/i) == null) {

               y.IsValid = true;
           }
           else {

               y.IsValid = false;
           }
       }
       
      
       function faq_Validate_ten(x, y) {
           str = (document.getElementById('<%=faq_ten.ClientID %>')).value;
           if (str.match(/([\<])([^\>]{1,})*([\>])/i) == null) {

               y.IsValid = true;
           }
           else {

               y.IsValid = false;
           }
       }

      
       function faq_Validate_chude(x, y) {
           str = (document.getElementById('<%=faq_chude.ClientID %>')).value;
           if (str.match(/([\<])([^\>]{1,})*([\>])/i) == null) {

               y.IsValid = true;
           }
           else {

               y.IsValid = false;
           }
       }
    </script>
</asp:Content>
